const axios = require('axios')
const { appid,secret } = require('../config/config')
axios.defaults.timeout = 10000

const GetSessionKey = async (code) => { 
    const res = await axios.get(`https://api.weixin.qq.com/sns/jscode2session?appid=${appid}&secret=${secret}&js_code=${code}&grant_type=authorization_code`)
    return res
}

module.exports = {
    GetSessionKey
}